#include "windows.h"

#define MIN_BLOCK_SIZE 1024 

typedef struct _SOHEAPSTATS;

typedef struct _SOHEAP {
	LPVOID Stack;
	LPVOID NextBlockAvailable;
	LONG  blocks[];	
} SOHEAP, *PSOHEAP;

HANDLE SOHeapCreate(DWORD blockSize, DWORD maxBlocks){
	if (blockSize<MIN_BLOCK_SIZE)
		return NULL;
	PSOHEAP Heap;
	Heap = (PSOHEAP) malloc(sizeof *Heap);
	Heap->Stack= malloc(blockSize*maxBlocks);
	Heap->NextBlockAvailable = Heap->Stack;
	return Heap;
}

VOID SOHeapDestroy(HANDLE heap){
	free(((PSOHEAP)heap)->Stack);
	free(heap);
}

LPVOID SOHeapAlloc(HANDLE heap){
	blocks[heap-
	return

}